# 10-综合案例.py
import csv  # csv是一种简单的文本格式，用于存储表格数据
# 1、读取文件
with open('./11-jielun.txt','r',encoding="utf-8") as file:
    data  = file.read()
# 2、把当前文件备份一次 （读取再写入 jielun.tXt.bak）
with open('12-jielun.txt.bak',"w",encoding="utf-8") as w_file:
    w_file.write(data)
    w_file.flush()
# 2、去除里面的测试
res = ""
with open('./11-jielun.txt','r',encoding="utf-8") as cs_file:
    for x in cs_file:
        # 检测是否包含测试标记
        if "测试" not in x:
           res=res+x
print(17,res)
with open('./13-jielun.txt','w',encoding="utf-8") as cs:
    cs.write(res)
